package org.lzy.shop.activity

import android.os.Bundle
import android.view.Window
import androidx.lifecycle.lifecycleScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.lzy.shop.base.BaseActivity
import org.lzy.shop.databinding.ActivitySplashBinding

class SplashScreenActivity : BaseActivity<ActivitySplashBinding>({ ActivitySplashBinding.inflate(it) }) {

    override fun onCreate(savedInstanceState: Bundle?) {
        // 移除不必要的延迟和淡入动画设置
        requestWindowFeature(Window.FEATURE_NO_TITLE)
        
        // 直接调用父类onCreate，避免额外的splashScreen安装步骤影响启动速度
        super.onCreate(savedInstanceState)
        

    }

    override fun initView() {
        // 移除OnPreDrawListener，避免不必要的绘制延迟
    }

    override fun initData() {
       lifecycleScope.launch {
           delay(1500)
           startKillActivity(MainActivity::class.java)

       }
    }

    override fun requestData() {
        // 启动时需要预加载的数据
    }

    override fun allClick() {
        // 添加点击事件处理
    }
}